Skip to content

Fix arena_sb_append_cstr by adding arena_strlen forward declaration#19

Open
savashn wants to merge 1 commit intotsoding:masterfrom
savashn:strlen
Open

Fix arena_sb_append_cstr by adding arena_strlen forward declaration#19
savashn wants to merge 1 commit intotsoding:masterfrom
savashn:strlen

Conversation

@savashn
Copy link

@savashn savashn commented Nov 20, 2025

Hello. This PR fixes implicit declaration error below by adding a forward declaration for arena_strlen(). Otherwise, calling #define ARENA_IMPLEMENTATIN in every .c file causes multiple definition errors.

In file included from main.c:2:
main.c: In functionmain’:
arena.h:136:20: error: implicit declaration of functionarena_strlen’; did you meanarena_strdup’? [-Wimplicit-function-declaration]
  136 |         size_t n = arena_strlen(s);        \
      |                    ^~~~~~~~~~~~
main.c:15:5: note: in expansion of macroarena_sb_append_cstr15 |     arena_sb_append_cstr(&arena, &sb, "Hello, ");
      |     ^~~~~~~~~~~~~~~~~~~~

@savashn
Copy link
Author

savashn commented Jan 4, 2026

Hi @rexim, sorry for pinning. I’ve updated the PR description to clarify the change. Just wanted to check if you had a chance to review this. Have a nice day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant